﻿using System;
using System.ComponentModel.DataAnnotations;

namespace AutoClub.Core.Domain
{
    public class User : BaseEntity<Guid>
    {
        #region Properties

        [Required]
        public string Email { get; private set; }

        [Required, MinLength(6)] //TO DO: ver de poner esto en el archivo de recursos
        public string Password { get; set; }

        /// <summary>
        /// Devuelve el rol activo
        /// </summary>
        [Required]
        public UserRol Rol { get; set; }

        [Required]
        public CarCategory RaceCategory { get; set; }

        [Required]
        public bool IsAdminApproved { get; set; }

        #endregion

        #region Constructors

        public User()
            : base()
        {
        }

        public User(string email, string password, UserRol rol, CarCategory category)
            : this(email, password, category)
        {
            this.Rol = rol;
        }

        public User(string email, string password, CarCategory category)
            : this()
        {
            this.Email = email;
            this.Password = password;
            this.RaceCategory = category;
        }

        #endregion
    }
}
